package com.test.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.test.comment.UserBean;
import com.test.dao.UserDao;

@Controller
@ResponseBody
@RequestMapping("/user")
public class Usercontroller {
	private Logger logger = Logger.getLogger(getClass());
	@Autowired
	public UserDao userDao;
   @RequestMapping("/demo")
   public ModelAndView godemo() {
	   return new ModelAndView("demo");
   }
   @RequestMapping("/gode")
   public Map<String, String> gode(String id){
	   
	   UserBean userBean = userDao.alluser();
	   logger.debug("=============userdao:"+userBean.getUsername());
	   Map<String, String> map = new HashMap<>();
	   map.put("msg", "yes");
	   return map;
   }
}
